package com.oa.framework.acc.account.service;

import com.alibaba.fastjson.JSON;
import com.oa.framework.acc.account.domain.UserSecurityInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;

/**
 * @author cuichao
 */
@Component
public class UserAccountSecurityService implements UserDetailsService {

    @Autowired
    private UserAccountService accountService;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return accountService.loadUserAccountSecurityInfo(username);
    }
}
